// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import http from '@/assets/js/axios'
import MintUI from 'mint-ui'
Vue.use(MintUI)//全局引入mint-ui
import 'mint-ui/lib/style.css'
//import fastClick from 'fastclick'
import 'babel-polyfill'
import '@/assets/css/base.css'

import store from './store/index.js'// store
import $ from 'jquery'
import 'jquery'//引入jquery


/* 引入Progress 进度条 */
// import NProgress from 'nprogress'
// import 'nprogress/nprogress.css'

//fastClick.attach(document.body)

Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
  //NProgress.start()
  if (to.meta.title) {
    document.title = to.meta.title
    
  }
  next()
})

router.afterEach((to, from,next) => {
  // NProgress.done()
  // window.scrollTo(0,0)
  //document.documentElement.scrollTop = 0
  document.getElementById('app').scrollTop = 0
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  http,
  components: { App },
  template: '<App/>',
  data: {
    eventHub: new Vue() // 使用集中的事件处理器,一劳永逸的在任何组件调用事件发射、接受的方法
  }  
})
